package com.heaboy.feedback.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.heaboy.feedback.mapper.QuestionAnswerMapper;
import com.heaboy.feedback.domain.QuestionAnswer;
import com.heaboy.feedback.service.IQuestionAnswerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 提问回答Service业务层处理
 * 
 * @author heaboy
 * @date 2024-02-01
 */
@Service
public class QuestionAnswerServiceImpl extends ServiceImpl<QuestionAnswerMapper, QuestionAnswer> implements IQuestionAnswerService
{
    @Autowired
    private QuestionAnswerMapper questionAnswerMapper;

    /**
     * 查询提问回答
     * 
     * @param id 提问回答主键
     * @return 提问回答
     */
    @Override
    public QuestionAnswer selectQuestionAnswerById(Long id)
    {
        return questionAnswerMapper.selectQuestionAnswerById(id);
    }

    /**
     * 查询提问回答列表
     * 
     * @param questionAnswer 提问回答
     * @return 提问回答
     */
    @Override
    public List<QuestionAnswer> selectQuestionAnswerList(QuestionAnswer questionAnswer)
    {
        return questionAnswerMapper.selectQuestionAnswerList(questionAnswer);
    }

    /**
     * 新增提问回答
     * 
     * @param questionAnswer 提问回答
     * @return 结果
     */
    @Override
    public int insertQuestionAnswer(QuestionAnswer questionAnswer)
    {
        questionAnswer.setCreateTime(DateUtils.getNowDate());
        return questionAnswerMapper.insertQuestionAnswer(questionAnswer);
    }

    /**
     * 修改提问回答
     * 
     * @param questionAnswer 提问回答
     * @return 结果
     */
    @Override
    public int updateQuestionAnswer(QuestionAnswer questionAnswer)
    {
        questionAnswer.setUpdateTime(DateUtils.getNowDate());
        return questionAnswerMapper.updateQuestionAnswer(questionAnswer);
    }

    /**
     * 批量删除提问回答
     * 
     * @param ids 需要删除的提问回答主键
     * @return 结果
     */
    @Override
    public int deleteQuestionAnswerByIds(Long[] ids)
    {
        return questionAnswerMapper.deleteQuestionAnswerByIds(ids);
    }

    /**
     * 删除提问回答信息
     * 
     * @param id 提问回答主键
     * @return 结果
     */
    @Override
    public int deleteQuestionAnswerById(Long id)
    {
        return questionAnswerMapper.deleteQuestionAnswerById(id);
    }
}
